/**
 * 过滤对象中为空的属性
 * @param obj
 * @returns {*}
 */
 export function filterObj(object) {
    const obj = JSON.parse(JSON.stringify(object))// 深拷贝
    if (!(typeof obj === 'object')) {
      return
    }
  
    for (const key in obj) {
      if (obj.hasOwnProperty(key) &&
        (obj[key] == null || obj[key] === undefined || obj[key] === '')) {
        delete obj[key]
      }
    }
    return obj
  }
  
  /**
   * 将JSon对象已输入的参数初始化
   * @param obj
   * @returns obj
   */
  export function restoreInitialValue(data) {
    for (const key in data) {
      if (data[key] instanceof Array) {
        data[key] = []
      } else if (data[key] instanceof Object) {
        data[key] = {}
      } else {
        data[key] = ''
      }
    }
  }
  
 
  